/* eslint-disable */
<template>
  <countTo :startVal="startVal" :endVal="endVal" :decimals="endVal|decimalsFilter" :duration="500"></countTo>
</template>

<script>
/* eslint-disable */
import countTo from "vue-count-to";
export default {
  components: { countTo },
  props: ["num"],
  filters: {
    decimalsFilter(num) {
      // console.log((num.toString().split("."))[1]==null)
      if (num.toString().split(".")[1] == undefined) {
        return 0;
      } else {
        return 2;
      }
    }
  },
  watch: {
    num(newName, oldName) {
      setTimeout(() => {
        // this.toOrderNum(newName);
        this.endVal = this.num;
        // console.log(newName);
      }, 200);
    }
  },
  data() {
    return {
      startVal: 0,
      endVal: 2017
    };
  },
  mounted() {
    this.endVal = this.num;
    // console.log(this.endVal);
  }
};
</script>